#include "ImageCache.h"

#include <SFML/Graphics.hpp>

ImageCache::ImageCache ():	tileTextures (),
							unitTextures (),
							buildingTextures (),
							hudTextures ()
{
	tileTextures[Image::BasicTile].loadFromFile ("Images/Tiles/BasicTile.jpg");

	unitTextures[Image::BasicUnit].loadFromFile ("Images/Units/basicUnit.jpg");

	buildingTextures[Image::BasicBuilding].loadFromFile ("Images/Buildings/basicBuilding.jpg");

	hudTextures[Image::Nation1HUD].loadFromFile ("Images/HUDs/Nation1HUD.png");
}

ImageCache& ImageCache::getInstance ()
{
	static ImageCache instance;
	return instance;
}

sf::Texture* ImageCache::getTileTexture (Image::TileTexture texture)
{
	return &tileTextures[texture];
}		

sf::Texture* ImageCache::getUnitTexture (Image::UnitTexture texture)
{
	return &unitTextures[texture];
}

sf::Texture* ImageCache::getBuildingTexture (Image::BuildingTexture texture)
{
	return &buildingTextures[texture];
}

sf::Texture* ImageCache::getHUDTexture (Image::HUDTexture texture)
{
	return &hudTextures[texture];
}